<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/mpd/config/config.php');

$maxpost=10;

$nip = $_SESSION['NIP'];

if(!isset($_GET['page'])){
	$pagenow = 1;
} else {
	$pagenow = $_GET['page'];
}
$jumlahhalaman=ceil(mysql_num_rows($query)/$maxpost);

$pagenow = ($pagenow-1)*$maxpost;

//baca tabel pekerjaan, jenis_pekerjaan, progress_pekerjaan dan status_pekerjaan
$query=mysql_query("SELECT p.ID_PEKERJAAN as id, p.NAMA_PEKERJAAN as nama, j.JENIS_PEKERJAAN as jenis, p.DUE_PEKERJAAN as due, r.WAKTU_PROGRESS as progress, s.STATUS_PEKERJAAN as status
					FROM pekerjaan as p INNER JOIN jenis_pekerjaan as j ON p.ID_JENIS = j.ID_JENIS INNER JOIN progress_pekerjaan as r ON p.ID_PEKERJAAN = r.ID_PEKERJAAN INNER JOIN status_pekerjaan as s ON p.ID_STATUS_PEKERJAAN = s.ID_STATUS_PEKERJAAN
					WHERE p.nip=".$nip." GROUP BY p.NAMA_PEKERJAAN ORDER BY r.WAKTU_PROGRESS DESC LIMIT $pagenow, $maxpost");  

?>